@extends('user.base.index')

@section('content')
    <!-- Deafult Table -->
                <div class="block-area" id="defaultStyle">
                    <h3 class="block-title">特价商品信息管理</h3>
                    @if (session('msg'))
                        <div class="alert alert-success">
                            {{ session('msg') }}
                        </div>
                    @endif
                    <form action='{{ url("admin/popular") }}' method='post' name='myform'>
                        <input type='hidden' name='_token' value='{{ csrf_token() }}'>
                        <input type='hidden' name='_method' value='DELETE'>
                    </form>

                    <form action='{{ url("admin/popular") }}' method='get'>
                        <div class='media-body'>
                            商品id<input type='text' class='form-control m-b-5' name='product_id'>
                        </div>
                        
                        <input type='submit' class='btn' value='搜索'>
                    </form>
                    
                    <div class="table-responsive overflow">
                        <table class="tile table table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th>序号</th>
                                    <th>产品id</th>
                                    
                                    <th>产品备注</th>
                                   
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                               @foreach($list as $v)
                                <tr>
                                   
                                    <td>{{$v->id}}</td>
                                    <td>{{$v->product_id}}</td>
                                   
                                    
                                    
                                    <td>{{$v->bak}}</td>
                                   
                                    <td><a href="javascript:doDel({{ $v->id }})" class='btn'>删除</a>
                                        <a href="{{ url('admin/popular').'/'.$v->id }}/edit" class='btn'>修改</a>
                                    </td>

                                    
                                </tr>
                                @endforeach
                            </tbody>
                        </table>
                       
                   
                   
                    <script type="text/javascript">
                        function doDel(id)
                        {
                            if(confirm('确定要删除吗？')){
                                var form = document.myform;
                                form.action = '/admin/popular/'+id;
                                form.submit()
                            }
                        }
                    </script>
                </div>
@stop

